<?php
/**
 * Created by PhpStorm.
 * User: hisheng
 * Date: 2017/6/6
 * Time: 19:18
 */
namespace App\Dao;
use App\User;

class UserDao
{
    public $user;
    
    public function __construct(User $user)
    {
        $this->user = $user;
    }
    
    public function findByMobile($mobile){
        $user = $this->user->where('mobile',$mobile)->first();
        return $user;
    }
    
    public function login($mobile,$password){
        $user = $this->user->where('mobile',$mobile)->where('password',md5($password))->first();
        return $user;
    }
    
}